﻿using System;
using System.Collections.Generic;
using System.Text;
using OT.Module.Model;

namespace OT.Module.Facade
{
    public interface IOrganization
    {
        IOrgCompany Company { get;}
        IOrgDepartment Department { get; }
        IOrgEmployee Employee { get; }
        IDepartmentPosition DepartmentPosition { get; }
    }

    public interface IOrgCompany
    {
        /// <summary>
        /// 根据公司ID获得下属的部门,含虚拟部门一级
        /// </summary>
        List<Org_Department> GetDepartments(string companyId);
        /// <summary>
        /// 根据公司ID获得真实的下属的部门
        /// </summary>
        List<Org_Department> GetTrulyDepartments(string companyId);
        /// <summary>
        /// 根据公司ID获得下属子公司
        /// </summary>
        List<Org_Company> GetSubCompanys(string parentCompanyId);
        /// <summary>
        /// 根据公司ID获得真实的下属子公司
        /// </summary>
        List<Org_Company> GetTrulySubCompanys(string parentCompanyId);
        /// <summary>
        /// 获得父公司
        /// </summary>
        Org_Company GetParentCopmany(string subCompanyId);
        /// <summary>
        /// 获得真实的父公司
        /// </summary>
        Org_Company GetTrulyParentCopmany(string subCompanyId);
        /// <summary>
        /// 获得同级公司
        /// </summary>
        List<Org_Company> GetPartnerCompany(string compnayId);
        /// <summary>
        /// 获得公司所有直属员工
        /// </summary>
        List<Org_Employee> GetEmployees(string compnayId);
        /// <summary>
        /// 获得所有公司
        /// </summary>
        List<Org_Company> GetAll();
        /// <summary>
        /// 获得公司所有岗位
        /// </summary>
        List<Org_Position> GetCompanyPositions(string companyId);
    }

    public interface IOrgDepartment
    {
        /// <summary>
        /// 获得部门所属的真实的公司
        /// </summary>
        Org_Company GetBelongCompany(string departmentId);

        /// <summary>
        /// 获得同级部门
        /// </summary>
        List<Org_Department> GetPartnerDepartments(string departmentId);

        /// <summary>
        /// 获得部门所有员工
        /// </summary>
        List<Org_Employee> GetEmployees(string departmentId);

        /// <summary>
        /// 获得子部门
        /// </summary>
        List<Org_Department> GetSubDepartments(string departmentId);

        /// <summary>
        /// 获得部门可以增加的岗位
        /// </summary>
        List<Org_Position> GetDepartmentCanAddPostions(string departmentId);

        /// <summary>
        /// 获得部门现有岗位
        /// </summary>
        List<Org_DepPosition> GetDepartmentPositions(string departmentId);
    }

    public interface IOrgEmployee
    {
        /// <summary>
        /// 获得员工所在的真实的公司
        /// </summary>
        Org_Company GetBelongCompany(string employeeId);

        /// <summary>
        /// 获得员工所在的真实的部门
        /// </summary>
        Org_Department GetBelongDepartment(string employeeId);
    }

    public interface IDepartmentPosition
    {
        /// <summary>
        /// 获得部门岗位上的所有员工
        /// </summary>
        List<Org_Employee> GetEmployees(string deptPostionId);
    }
}
